$().ready(() => {
  let id = window.location.search.split("?id=").join('')
  let detailData = Interceptor('/detailPage', 'get', {
    'id': id
  }).data
  let pollNum = detailData.poll_number;

  $('.poll-countdown').text('投票结束时间：' + detailData.end_time);
  $('.poll-title').text(detailData.name);
  $('.poll-info img').attr('src', detailData.img);
  $('.poll-message').text(detailData.content);
  $('.poll-user').text('项目发起人：' + detailData.userName);

  for (let i = 0; i < detailData.optMsg.length; i++) {
    let pollList = `
        <div class="poll-list" num="${detailData.optMsg[i]['optId']}">
        <span>${detailData.optMsg[i]['content']}</span>
        <div>${detailData.optMsg[i]['count']} 票</div>
        </div>`
    $('.poll-ul').append(pollList)
  }
})